project('tutorial', 'c')
module_inc = include_directories('../../src/')
module_srcdir = '../../src/'
module_srcs = files([
  module_srcdir + 'tscell.c',
  module_srcdir + 'tsdna.c',
  module_srcdir + 'tssynapse.c',
  ])
glib_compile_schemas = find_program('glib-compile-resources')
sub_srcdir = './'
sub_srcs = files([
  sub_srcdir + 'tsapp.c',
  ])
g_resource_xml = files([sub_srcdir + '83net.gresource.xml'])
ui_src = files('main.ui')
resources_src = custom_target('resources.c',
  #input:[ui_src, g_resource_xml],
  input:[g_resource_xml, ui_src],
  output:['resources.c'],
  command:[glib_compile_schemas, '@INPUT0@',
    '--target', '@OUTPUT@',
    '--sourcedir', '../',
    '--generate-source'],
  )
cairo_dep = dependency('cairo')
glib_dep = dependency('glib-2.0')
gtk_dep = dependency('gtk+-3.0')
mosquitto_dep = dependency('libmosquitto')
sqlite3_dep = dependency('sqlite3')
json_glib_dep = dependency('json-glib-1.0')
executable('human', 'main.c', sub_srcs, resources_src, module_srcs,
  #build_rpath : '/home/imch/ts/lib',
  #install_rpath : '/home/imch/ts/lib',
  include_directories: [module_inc],
  dependencies : [glib_dep, json_glib_dep, gtk_dep, sqlite3_dep])
